package net.onecloud.onecloud.network.service;


import net.onecloud.onecloud.model.ResultUser;
import net.onecloud.onecloud.model.User;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;

import rx.Observable;
import rx.Observer;

/**
 * Created by zaizai on 16/7/11.
 */
public interface AccountService {
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/OneCloud/user/register")
    Observable<ResultUser> register(@Body User user);

    @GET("/OneCloud/user/check/{username}")
    Observable<ResultUser> checkUserName(@Path(value = "username") String username);

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/OneCloud/user/login")
    Observable<ResultUser> login(@Body User user);

}
